package com.activity.dao.impl;

import javax.annotation.Resource;

import org.apache.ibatis.session.SqlSession;
import org.apache.ibatis.session.SqlSessionFactory;
import org.mybatis.spring.support.SqlSessionDaoSupport;
import org.springframework.stereotype.Component;

import com.activity.dao.SaveActivityDao;
import com.activity.model.Activitys;
@Component
public class SaveActivityDaoImpl extends SqlSessionDaoSupport  implements SaveActivityDao {

	@Resource
	@Override
	public void setSqlSessionFactory(SqlSessionFactory sqlSessionFactory) {
		// TODO Auto-generated method stub
		super.setSqlSessionFactory(sqlSessionFactory);
	}
	
	@Override
	public boolean ActivitySave(Activitys activitys) {
		SqlSession session = getSqlSession();
		String statement = "com.activity.mapper.SaveActivityMapper.saveActivity";
		int result = session.insert(statement, activitys);
		return result == 1 ? true : false;
	}

}
